#coding:utf-8
from functools import reduce
import time

def performance(f):
    def fn(*args,**kvargs):
        t1=time.time()
        r=f(*args,**kvargs)
        t2=time.time()
        print ('call %s() in %d '%(f.__name__, (t2 - t1)))
        #print(r)
        return r
    return fn

@performance
def factorial(n):
    return reduce(lambda x,y: x*y, range(1, n+1))

print (factorial(10))